﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace GuiLayer
{
    /// <summary>
    /// Interaction logic for AdminPanel.xaml
    /// </summary>
    public partial class ApLogin : Window
    {
        public ApLogin()
        {
            InitializeComponent();
        }



        private void btnLogin_Click_1(object sender, RoutedEventArgs e)
        {
            //username = txtUser.Text;
            //password = txtPass.Password;
            //bool loggedin = false;
            //dsMembers = wsMembers.GetAllMembers();

            //foreach (DataRow row in dsMembers.Tables[0].Rows)
            //{
            //    if (username.Equals(row["member_username"]) && password.Equals(row["member_password"]))
            //    {
            //        loggedin = true;
            //        loggedInUser = (int)(row["member_id"]);
            //        if (row["member_role"].Equals("Admin"))
            //        {
            //            adminPanel admin = new adminPanel();
            //            admin.Show();
            //            this.Hide();
            //            break;
            //        }
            //        else
            //        {
            //            userForm user = new userForm(loggedInUser);
            //            user.Show();
            //            this.Hide();
            //            break;
            //        }
            //    }
            //}
            //if (loggedin == false)
            //{
            //    MessageBox.Show("Wrong login or password", "Loginerror", MessageBoxButton.OK, MessageBoxImage.Error);
            //    txtUser.Clear();
            //    txtPass.Clear();
            //    txtUser.Focus();
            //}
            this.Close();
            ApAlgemeen f2 = new ApAlgemeen();
            f2.ShowDialog();
            
        }

        private void btnTerug_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
           MainWindow f1 = new MainWindow();
            f1.ShowDialog();
        }
    }
}
